#include <iostream>
#include <string>


int main()
{
std::string inputString;
std::cout << "Enter a string using round brackets: ')' or '(' ";
std::getline(std::cin, inputString);

int openBrackets = 0;
bool isValid = true;

for (char character : inputString) {
    if (character == '(') {
        openBrackets++;
    } else if (character == ')') {
        if (openBrackets > 0) {
            openBrackets--;
        }
        else
        if (character == '[') {
        openBrackets++;
    } else if (character == ']') {
        if (openBrackets > 0) {
            openBrackets--;
        }
        else
        {
            isValid = false;
            break;
    if (character == '{') {
        openBrackets++;
    } else if (character == '}') {
        if (openBrackets > 0) {
            openBrackets--;
        } else {
            isValid = false;
            break;
            {
            isValid = false;
            break;
        }
    }
}


if (openBrackets > 0 || !isValid) {
    std::cout << "Incorrect\n";
} else {
    std::cout << "Correct\n";
}

}
